<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<!--这meta的作用就是删除默认的苹果工具栏和菜单栏。-->
<meta name="apple-mobile-web-app-capable" content="yes"/>
<!--在web app应用下状态条（屏幕顶部条）的颜色-->
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<!--该标签用于指定是否将网页内容中的手机号码显示为拨号的超链接。-->
<meta name="format-detection" content="telephone=no"/>
<!--网页在任何时候都不能被Cache存储-->
<meta http-equiv="Expires" content="-1"/>
<!--清除缓存-->
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Pragma" content="no-cache"/>
<title></title>
<link href="${ctx}/static/newweb/css/zc.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/static/newweb/css/footer.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/newweb/css/mdialog.css"/>
<script src="${ctx}/static/newweb/js/zepto.min.js"></script>
<script src="${ctx}/static/newweb/js/mdialog.js"></script>
<script  language="javascript" type="text/jscript">
function home(mid){
	window.location="${ctx}/wechatapi/personal?mid="+mid;
}
function toedit(){
	window.location="${ctx}/wechatapi/toeditperson";
}

//他关注的人
function myfollowperson(){
	window.location="${ctx}/wechatapi/myfollowperson?mid=${person.id}";
}

//关注他的人
function mybfollowperson(){
	window.location="${ctx}/wechatapi/mybfollowperson?mid=${person.id}";
}

//关注的问题
function followask(){
	window.location="${ctx}/wechatapi/followask?mid=${person.id}";
}

//提过的问题
function myask(){
	window.location="${ctx}/wechatapi/myask?mid=${person.id}";
}

//收藏的问题
function shoucang(){
	window.location="${ctx}/wechatapi/mycollection?type=collection&mid=${person.id}";
}
//回答的问题
function myanswer(){
	window.location="${ctx}/wechatapi/myanswer?type=answer&mid=${person.id}";
}
$(function(){
	if (${ispraise} == 1){
		$("#qxgz").css('display','block');
		$("#gz").css('display','none');
	}else if(${ispraise} == 0){
		$("#qxgz").css('display','none');
		$("#gz").css('display','block');		
	}else if(${ispraise} == 2){
		$("#qxgz").css('display','none');
		$("#gz").css('display','none');		
	}
});

//关注用户
function follow(){
	var mid = '${person.id}';
	$.ajax({
		type: 'POST',
		url: '${ctx}/wechatapi/followperson',
		dataType: 'json',
		data:{
			mid:mid
		},
		success: function(data){
			new TipBox({
				type:'success',
				str:'操作成功',
				hasBtn:false,
				setTime:1000,
				callBack:function(){
					$("#follow").html(data);
					$("#qxgz").css('display','block');
					$("#gz").css('display','none');
				}
			});
		}
	});	
}

//取消关注用户
function nofollow(){
	var mid = '${person.id}';
	$.ajax({
		type: 'POST',
		url: '${ctx}/wechatapi/noFollowperson',
		dataType: 'json',
		data:{
			mid:mid
		},
		success: function(data){
			new TipBox({
				type:'success',
				str:'操作成功',
				hasBtn:false,
				setTime:1000,
				callBack:function(){
					$("#follow").html(data);
					$("#qxgz").css('display','none');
					$("#gz").css('display','block');
				}
			});
		}
	});	
}
</script>
</head>
<body>
<div class="top">
    <span>${person.nickname!}的个人主页</span>
        <div class="imgbox">
<%
  if (person.headimgurl == null){
%>
<img class="topone" src="${ctx}/static/newweb/img/wechat.png" onclick="home('${person.id}')"/>
<%
  }else{
%>
<img class="topone" src="${person.headimgurl!}46" onclick="home('${person.id}')"/>
<%
  }
%>
</div>
    <div class="sz">
    <%
       if (session.member.id == person.id){
    %>
        <img src="${ctx}/static/newweb/img/shuxie.png" onclick="toedit()"/>
    <%}%>
	</div>
    
    <div class="gg">
    <%
       if (session.member.id != person.id){
    %>  
      <span class="qxgz" id="qxgz" onclick="nofollow()">取消关注</span>
      <span class="gz"   id="gz"   onclick="follow()">关注</span>
    <%}%>
    </div>
    <div class="xm">${person.nickname!}</div>    
</div>
<div class="main">
	<p>${person.autograph!}</p>
	<div class="gzwt" onclick="followask()">
        <h1>关注的提问</h1>
        <p style="margin-left:2px">${follows!}</p>
    </div>   
	<div class="gzw" onclick="mybfollowperson()">
        <h1><%if(session.member.id == person.id){%>关注我的人<%}else{%>关注他的人<%}%></h1>
        <p style="margin-left:2px" id="follow">${praisyous!}</p>
    </div>
    <div class="wgz" onclick="myfollowperson()">
        <h1><%if(session.member.id == person.id){%>我关注的人<%}else{%>他关注的人<%}%><h1>
        <div style="margin-left:2px">${praispersons!}</div>
    </div> 
    <div class="dz">
        <img src="${ctx}/static/newweb/img/dianzan.png" />
        <span>${praise!}</span>
    </div>
</div>
<div class="bj"></div>
<div class="ban">
    <div onclick="myanswer()">
        <div class="gnl">
            <img src="${ctx}/static/newweb/img/yuedu.png" />
            <span>答过</span>
        </div>
        <div class="gnr">
            <img src="${ctx}/static/newweb/img/jt.png" />
            <span>${replys!}</span>
        </div>
        <div class="clearfix"></div>
    </div>
    <div class="bs"></div>
        <div onclick="myask()">
        <div class="gnl">
            <img src="${ctx}/static/newweb/img/wen.png" />
            <span>问过</span>
        </div>
        <div class="gnr">
            <img src="${ctx}/static/newweb/img/jt.png" />
            <span>${asks!}</span>
        </div>
        <div class="clearfix"></div>
    </div>
    <div class="bs"></div>
        <div onclick="shoucang()">
        <div class="gnl">
            <img src="${ctx}/static/newweb/img/sc.png" />
            <span>收藏</span>
        </div>
        <div class="gnr">
            <img src="${ctx}/static/newweb/img/jt.png" />
            <span>${collections!}</span>
        </div>
        <div class="clearfix"></div>
    </div>
</div>
<div class="footer">
    <a href="${ctx}/wechatapi/portal" class="footerl"><img src="${ctx}/static/newweb/img/zhuye.png" /></a>
    <a href="${ctx}/wechatapi/search" class="footerr"><img src="${ctx}/static/newweb/img/sousuo.png" /></a>
</div>
<div class="fix">
<a href="${ctx}/wechatapi/ask">问</a>
</div>
</body>
</html>
